package com.note.es.mapping;

import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Set;

/**
 * @ClassName: Hot
 * @Description: 首页mapping属性
 * @Author: yfeng
 * @Date: 2018/11/15 6:39 PM
 */
public class Hot {

    public final static String ID = "id";
    public final static String MEDIA_NAME = "mediaName";
    public final static String MEDIA_T_NAME = "mediaTname";
    public final static String SENTIMENT_NAME = "sentimentName";
    public final static String SENTIMENT_ID = "sentimentId";
    public final static String PUBDATE = "pubdate";
    public final static String PUBTIME = "pubtime";
    public final static String TRANSFER  = "transfer";
    public final static String CATEGORY = "category";
    public final static String EVENT_ID = "eventId";
    public final static String TITLE = "title";
    public final static String TEXT  = "text";
    public final static String URL = "url";
    public final static String IS_EVENT = "isEvent";
    public final static String REGION = "region";

    private static Set<String> fields;

    static {
        try {
            fields = new HashSet<>();
            Field[] clazzFields = Hot.class.getFields();
            for (Field clazzField : clazzFields) {
                fields.add(String.valueOf(clazzField.get(null)));
            }
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }
    public static Set<String> getFields() {
        return fields;
    }
}
